package edu.fafu.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import edu.fafu.dao.ILoginDao;
import edu.fafu.dao.IQuestionDao;
import edu.fafu.entity.Admin;
import edu.fafu.entity.Question;
import edu.fafu.service.ILoginService;
import edu.fafu.service.IQuestionService;
import edu.fafu.util.PageBean;
@Service("questionService")
public class QuestionService implements IQuestionService{
	@Resource(name="questionDao")
	private IQuestionDao questionDao;
	@Transactional
	@Override
	public PageBean queryQuestion(String condition,PageBean pb) {
		return questionDao.queryQuestion(condition,pb);
	}
	@Transactional
	@Override
	public void addQuestion(Question q) {
		questionDao.addQuestion(q);
	}
	@Transactional
	@Override
	public void updateQuestion(Question q) {
		questionDao.updateQuestion(q);
	}
	@Transactional
	@Override
	public void deleteQuestion(int id) {
		questionDao.deleteQuestion(id);
	}
	@Transactional
	@Override
	public PageBean queryAllQuestion(PageBean pb) {
		return questionDao.queryAllQuestion(pb);
	}
	@Transactional
	@Override
	public Question queryQuestionOne(int id) {
		return (Question) questionDao.queryQuestion(id);
	}
	@Transactional
	@Override
	public PageBean queryAnswer(Question q,PageBean pageBean) {
		return questionDao.queryAnswer(q,pageBean);
	}
	@Override
	public PageBean queryQuestionByUser(int userId, PageBean pageBean) {
		return questionDao.queryQuestionByUser(userId,pageBean);
	}

	
	
}
